<template>
  <div class="main">
    <div class="contactus-Bak"></div>
    <div class="contactus-column">
      <div class="column" v-for="item in storyInfo" :key="item.id">
        <div class="column-img">
          <img :src="item.storyimg" onclick="return false" alt="" />
        </div>
        <div class="column-title">
          <h1>{{ item.storytitle }}</h1>
          <h2>{{ item.storytitle }}</h2>
          <div class="column-title-time">
            <h3 class="web-font">{{ item.time.substring(5, 10) }}</h3>
            <h4>/{{ item.time.substring(0, 4) }}</h4>
          </div>
        </div>
        <div class="column-btn" v-if="!$store.state.screenWidth">
          <div class="btn">More</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      storyInfo: [
        {
          id: "1",
          storyimg: "http://text.66666666.ink/storytitle/story1.jpg",
          storytitle: "衣食住行,谨防宝宝过敏",
          time: "3/20/2021 15:11:50",
        },
        {
          id: "2",
          storyimg: "http://text.66666666.ink/storytitle/story2.jpg",
          storytitle: "乍暖还寒，卫衣让你美丽不冻人",
          time: "3/20/2021 17:26:22",
        },
        {
          id: "3",
          storyimg: "http://text.66666666.ink/storytitle/story3.jpg",
          storytitle: "春意盎然，哪句诗词符合眼前美景呢？",
          time: "3/20/2021 17:30:02",
        },
        {
          id: "4",
          storyimg: "http://text.66666666.ink/storytitle/story4.png",
          storytitle: "春分：春风如贵客，一到便繁华\r\n",
          time: "3/20/2021 18:18:23",
        },
      ],
    };
  },
  mounted() {
   // this.getStory();
  },
  methods: {
    async getStory() {
      const res = await this.$myRequest.post("getstory");
      this.storyInfo = res.data.data;
      console.log(this.storyInfo);
    },
  },
};
</script>
<style lang="scss" scoped>
@font-face {
  font-family: "webfont";
  font-display: swap;
  src: url("//at.alicdn.com/t/webfont_wq8hklsmov9.eot"); /* IE9*/
  src: url("//at.alicdn.com/t/webfont_wq8hklsmov9.eot?#iefix")
      format("embedded-opentype"),
    /* IE6-IE8 */ url("//at.alicdn.com/t/webfont_wq8hklsmov9.woff2")
      format("woff2"),
    url("//at.alicdn.com/t/webfont_wq8hklsmov9.woff") format("woff"),
    /* chrome、firefox */ url("//at.alicdn.com/t/webfont_wq8hklsmov9.ttf")
      format("truetype"),
    /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
      url("//at.alicdn.com/t/webfont_wq8hklsmov9.svg#思源黑体-极细")
      format("svg"); /* iOS 4.1- */
}
.web-font {
  font-family: "webfont" !important;
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.main {
  width: 100%;
  height: auto;
  display: flex;
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
  .contactus-Bak {
    width: 120px;
    height: 50px;
    box-sizing: border-box;
    background: url(http://text.66666666.ink/bishe/bysg.png) center no-repeat;
    background-size: 100%;
  }
  .contactus-column {
    width: 100%;
    border-top: 0.5px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    .column {
      width: 60%;
      height: 100px;
      padding: 10px 5px;
      box-sizing: border-box;
      border-bottom: 0.5px solid #eee;
      display: flex;
      justify-content: space-between;
      .column-img {
        width: 30%;
        height: 100%;
        img {
          width: 85%;
          height: 100%;
          border-radius: 4px;
        }
      }
      .column-title {
        width: 45%;
        height: 100%;
        padding: 10px 0;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        h1 {
          font-size: 10px;
          color: #444444;
        }
        h2 {
          font-size: 8px;
          color: #7d7d7d;
        }
        .column-title-time {
          display: flex;
          flex-direction: row;
          align-items: flex-end;
          h3 {
            font-size: 12px;
            font-weight: 100;
            color: #a3afb7;
            margin-right: 5px;
          }
          h4 {
            font-size: 8px;
            font-weight: 100;
            color: #a3afb7;
          }
        }
      }
      .column-btn {
        width: 25%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        .btn {
          width: 50%;
          height: 15px;
          font-size: 6px;
          text-align: center;
          line-height: 15px;
          color: #43c9c3;
          border: 0.5px solid #43c9c3;
          transition: all 0.5s;
        }
        .btn:hover {
          cursor: pointer;
          color: #fff;
          background: #43c9c3;
        }
      }
    }
  }
}
@media screen and (max-width: 750px) {
  .main {
    .contactus-Bak {
      width: 400px;
      height: 100px;
      margin-top: 20px;
      box-sizing: border-box;
      background: url(http://text.66666666.ink/bishe/bysg.png) center no-repeat;
      background-size: 100%;
    }
    .contactus-column {
      width: 100%;
      border-top: 0.5px solid #eee;
      display: flex;
      flex-direction: column;
      align-items: center;
      .column {
        width: 80%;
        height: 160px;
        padding: 10px 5px;
        box-sizing: border-box;
        border-bottom: 0.5px solid #eee;
        display: flex;
        justify-content: space-around;
        .column-img {
          width: 40%;
          height: 100%;
          img {
            width: 90%;
            height: 100%;
            border-radius: 4px;
          }
        }
        .column-title {
          width: 60%;
          height: 100%;
          padding: 10px 0;
          box-sizing: border-box;
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          h1 {
            font-size: 28px;
            color: #444444;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }
          h2 {
            font-size: 22px;
            color: #7d7d7d;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }
          .column-title-time {
            display: flex;
            flex-direction: row;
            align-items: flex-end;
            h3 {
              font-size: 20px;
              font-weight: 100;
              color: #a3afb7;
              margin-right: 5px;
            }
            h4 {
              font-size: 18px;
              font-weight: 100;
              color: #a3afb7;
            }
          }
        }
      }
    }
  }
}
</style>
